rm(list = ls())

## 

library(tidyverse)
library(lfe)
library(stargazer)

## Get data

df <- read_rds("data/data_tenders.rds")

## Models


m1 <- felm(tender_any ~ bt_ssz_total_2016 + bt_pop_2012| 0 | 0 | 0, 
           data = df)
m2 <- felm(tender_any ~ bt_ssz_total_2016 + bt_pop_2012| state | 0 | 0, 
           data = df)
m3 <- felm(tender_any ~ bt_spending_total_2016 + bt_pop_2012| 0 | 0 | 0, 
           data = df)
m4 <- felm(tender_any ~ bt_spending_total_2016 + bt_pop_2012| state | 0 | 0, 
           data = df)

# Table A.11: tendering ----

stargazer(list(m1, m2 , m3, m4),
          keep = 'bt_ssz_total_2016|bt_spending_total_2016',
          covariate.labels = c('Transfers (Euro, scaled)', 
                               'Spending (Euro, scaled)'),
          keep.stat = c('n', 'rsq'),
          add.lines = list(c('Controlling for pop.', rep('Yes', 4)),
                           c('State FE', rep(c('No', 'Yes'), 2))),
          style = 'ajps', dep.var.labels = 'DV: Any tenders listed (0/1)', 
          model.numbers = F, 
          title = 'Probability of listing tenders conditional on transfers/spending',
          label = 'tab:tender_reg')
